find a string hackerrank solution in python

visit shbcf.ru